﻿Public Class EmkMaasBordroYD
	Inherits ProcessReport

	Dim donem As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Emeklilik Yurtdışı Maaş Bordrosu Dökümü", "Maaş ödeme dönemini seçin.")
				donem = AddCombo("@donem", "Maaş Dönemi", Emeklilik.Maas.DonemSource, "nl;width=20", "--first--")
				Landscape = True
			Case EventType.ValidateForm
				Rs = Emeklilik.Maas.YurtdisiBordro(Remote, donem.yil, donem.ay)
				Rs.CreateSuperset("odeyerkod,odemeyeri,sum(maas),sum(vergi),sum(netmaas)")
				e.Result = True
			Case EventType.PageHeader
				Report.PrintReportInfo("YURTDIŞI HAVALE İLE AYLIK ALANLAR LİSTESİ", "ÖDEME YERİ: " & Rs.Superset("odeyerkod") & " - " & Rs.Superset("odemeyeri"), "DÖNEM : " & donem.display)
				Report.SetColumns(";Adı soyadı;Maaş;Banka adı;Banka şubesi;Banka hesap no.", "1;6;2;6;6;6", "r;l;m;l;l;l", "--")
			Case EventType.ReportDetail
				For Each Row1 In Rs.Superset
					Rs.CreateSubset("odeyerkod=" & Rs.Superset("odeyerkod"))
					Dim n As Integer = 1
					For Each Row2 In Rs.Subset
						Report.Print(n, Rs.Subset("adi"), Rs.Subset("maas"), Rs.Subset("bankaadi"), Rs.Subset("bsubeadi"), Rs.Subset("bankahno"))
						n += 1
					Next
					Report.PrintTotal("<cs=2><r>" & Rs.Subset.Count & " ADET", Rs.Superset("summaas"), "<cs=3>")
					Report.EndPage()
				Next
		End Select
	End Sub

End Class
